Trò chơi Pac-Man

20.570 lượt xem;
1 using UnityEngine;
2 using
System.Collections;
3
4 public
class Move : MonoBehaviour {
5
6     
public float speed;
7     
8     
// Update is called once per frame
9     
void Update ()
10     {
11         transform.Translate(Vector3.left * speed * Time.deltaTime);
12     }
13
14     
void OnTriggerEnter2D(Collider2D col)
15     {
16         Destroy(gameObject);
17     }
18 }


Update is called once per frame



Gõ tìm kiếm nhanh...